package com.project.CourseManager;

import android.graphics.PixelFormat;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.view.ViewPager;
import android.support.v4.view.ViewPager.OnPageChangeListener;
import android.view.View;
import android.view.Window;

import com.project.Library.testListFragAdapter;
import com.project.trac.R;

public class test_CourseManager extends FragmentActivity {

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.d_course_manager);

		testListFragAdapter ca = new testListFragAdapter(getApplicationContext(),
				getSupportFragmentManager());
		ViewPager viewpager_ClassroomManager;

		viewpager_ClassroomManager = (ViewPager) findViewById(R.id.viewpager_coursemanager);

		viewpager_ClassroomManager.setAdapter(ca);
		viewpager_ClassroomManager.setCurrentItem(0);

		viewpager_ClassroomManager
				.setOnPageChangeListener(new OnPageChangeListener() {

					/* call on the generic_indicators */
					public void onPageSelected(int position) {

						switch (position) {

						case 0:
							findViewById(R.id.generic_tab_first).setVisibility(
									View.VISIBLE);
							findViewById(R.id.generic_tab_second).setVisibility(
									View.INVISIBLE);
							break;

//						case 1:
//							findViewById(R.id.generic_tab_first).setVisibility(
//									View.INVISIBLE);
//							findViewById(R.id.generic_tab_second).setVisibility(
//									View.VISIBLE);
//							break;
						}
					}
					/* unused methods */
					public void onPageScrollStateChanged(int position) {}
					public void onPageScrolled(int arg0, float arg1, int arg2) {}
				});
	}
	
	@Override
	public void onAttachedToWindow() {
		super.onAttachedToWindow();
		Window window = getWindow();
		window.setFormat(PixelFormat.RGBA_8888);
	}
}